all: download/openssl-3.5.2.tar.gz
	rm -rf temp build
	mkdir -p temp build/bin
	cd temp && tar xvf ../download/openssl-3.5.2.tar.gz
	cd temp/openssl-3.5.2 && cat ../../0001-ohos-getauxval.diff | patch -Np1
	cd temp/openssl-3.5.2 && ./Configure linux-aarch64 shared no-tests --prefix=/data/app/base.org/base_1.0 --openssldir=/data/app/base.org/base_1.0 -D__OHOS__ CC=$(OHOS_SDK_HOME)/native/llvm/bin/aarch64-unknown-linux-ohos-clang AR=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ar RANLIB=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-ranlib STRIP=$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip
	cd temp/openssl-3.5.2 && make -j $(shell nproc)
	cd temp/openssl-3.5.2 && make install_sw DESTDIR=$(shell pwd)/build
	mkdir -p ../sysroot
	$(OHOS_SDK_HOME)/native/llvm/bin/llvm-strip build/data/app/base.org/base_1.0/lib/*.so
	rm -f ./build/data/app/base.org/base_1.0/lib/*.a
	cp -rv ./build/data/app/base.org/base_1.0/. ../sysroot | tee file.lst

download/openssl-3.5.2.tar.gz:
	mkdir -p download
	cd download && wget https://gitee.com/nanqu_ait/termony-hnp/releases/download/openssl/openssl-3.5.2.tar.gz
